/**
 * @file    Expression classname is undefined on line 2, column 15 in Templates/Classes/Class.java.
 * @author  Haseeb Yousaf
 * @see     LICENSE (MIT style license file)
 * @version 1.0
 * @date    Nov 14, 2011 12:44:06 PM
 */
package carrello.impl.boundary.user;

import carrello.impl.boundary.AbstractUI;

import carrello.impl.controller.user.SignUpCTRL;

public class SignUpUI extends AbstractUI {
    private int userid;
    private String username;
    private String password;
    private String email;
    private String role;
    private String address;
    private String firstName;
    private String lastName;
    
    public String getAddress () {
        return address;
    }
    public void setAddress ( String add ) {
        address = add;
    }
    public String getFirstname () {
        return firstName;
    }
    public void setFirstname (String first) {
        firstName = first;
    }
    public String getLastname () {
        return lastName;
    }
    public void setLastname (String last) {
        lastName = last;
    }
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public int getUserid() {
        return userid;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    public String execute()
    {
        if (username == null)
        {
            return INPUT;
        } else
        if (SignUpCTRL.verify(this.username)) {
            SignUpCTRL.addUser(this.username, this.password, this.email, this.firstName, this.lastName, this.address);
            return SUCCESS;
        }else{
            return ERROR;
        }
        
    }

    
            
    
    
    
}
